#include "contacts.pb.h"
#include <iostream>

int main()
{
    contacts::PeopleInfo info;
    info.set_name("小白");
    info.set_age(18);
    std::string str = info.SerializeAsString();

    contacts::PeopleInfo stu;
    bool ret = stu.ParseFromString(str);
    if(ret == false) 
    {
        std::cout << "序列化反序列化失败" << std::endl;
        return -1;
    }
    std::cout << stu.name() <<std::endl;
    std::cout << stu.age() <<std::endl;
    return 0;
}